package com.fit.user.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import com.fit.user.dao.HouWenMsgDAO;
import com.fit.user.form.HouWenMsgForm;


public class HouWenMsgAction extends DispatchAction {
	public ActionForward submitHouWenMsg(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		
		
		HouWenMsgForm houWenMsgForm = (HouWenMsgForm)form;
		HouWenMsgDAO houWenMsgDAO = new HouWenMsgDAO();

		boolean flag = houWenMsgDAO.submitHouWenMsg(houWenMsgForm.getHouWenMsgEntity());
		//HttpSession session = request.getSession();
		if (flag ) {
			return mapping.findForward("success");
		} else {
			return mapping.findForward("fail");
		}

	}
}
